import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/classes',
    method: 'get',
    params: query
  })
}
// 获取班级详情
export function fetchClasses(id) {
  return request({
    url: '/classes/' + id,
    method: 'get'
    // params: { id }
  })
}

export function fetchPv(pv) {
  return request({
    url: '/classes/pv',
    method: 'get',
    params: { pv }
  })
}
// 创建班级
export function storeClasses(data) {
  return request({
    url: '/classes',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: '/classes/' + data.id,
    method: 'put',
    data
  })
}
export function getClassesCategory(pid) {
  return request({
    url: '/categorys',
    method: 'get',
    params: { pid }
  })
}
export function getCategoryList(id) {
  return request({
    url: '/categorys/tree_list',
    method: 'get',
    params: { id }
  })
}
export function getCategoryListOrder(id) {
  return request({
    url: '/categorys/tree_order',
    method: 'get',
    params: { id }
  })
}

